@echo off
REM Windows环境变量设置脚本
REM 解决OpenMP冲突和优化训练环境

echo 设置训练环境变量...

REM 修复OpenMP冲突
set KMP_DUPLICATE_LIB_OK=TRUE
set OMP_NUM_THREADS=1

REM 优化CUDA设置
set CUDA_LAUNCH_BLOCKING=1
set PYTORCH_CUDA_ALLOC_CONF=max_split_size_mb:128

echo 环境变量已设置:
echo   KMP_DUPLICATE_LIB_OK=%KMP_DUPLICATE_LIB_OK%
echo   OMP_NUM_THREADS=%OMP_NUM_THREADS%
echo   CUDA_LAUNCH_BLOCKING=%CUDA_LAUNCH_BLOCKING%
echo   PYTORCH_CUDA_ALLOC_CONF=%PYTORCH_CUDA_ALLOC_CONF%

echo.
echo 现在可以运行训练脚本:
echo   python quick_train_fixed.py

pause
